Conversation
616abec to
94de823
Compare
|
Hello @benoitdenkinger , When would you need to use EXCLUDE_IPS when calling get_ip_sources()? |
6aafe6b to
814d689
Compare
20c9cc1 to
77b44c5
Compare
19d1371 to
52dfe81
Compare
|
When moving to implementation, dividing a design into hierarchical blocks is often needed. In this case, it could be nice to get all the sources from one IP excluding the sources of some lower levels hierarchical blocks in order to implement only the needed part. Could you (re)explain me the reason for the need of the topological sorting? I didn't see a way to do that easily with the current solution, so I wanted to try doing it another way to test if such a feature works and is interesting. What I did is to rely on the INTERFACE_LINK_LIBRARIES property to traverse the IPs and get the source files. This way, I can easily stopped at a IP/hierarchical level provided by the EXCLUDED_IPS parameter. It's probably not working for everything but this is for now only to test the EXCLUDED_IPS feature (actually I opened the PR mostly to test the gitlab-ci-approved labeling to trigger the gitlab CI from a fork PR). |
But shouldnt you do this filtering outside? Not sure how this should work with xcelium, as if you exclude a certain IP block, it will not simulate as you would get missing module error?
For many languages like SystemVerilog or SystemRDL it is needed to compile source files in hierarchical order, but this is not easy to do when you have tree graph of dependencies. It is not easy to understand which IP needs to be compiled before another as the tree branches. Forr tools like Verilator also, all the files need to be passed to the CLI tool as one command, and these files need to be passed in order, lowest hierarchy modules first, highest last. Ok I see this is a draft pull request, but if you need help or you have some specific use case that we cannot cover yet with HWIP API, lets discuss to see what options there are |
EXCLUDE IPS FEATUREUSE CASEAbout excluding IP outside the function, the problem is that I want to exclude an IP and all its dependencies. If I have: The context is that now I have a design I want to implement. Let's say I have: When I simulate my design, I don't exclude anything. But when I implement it, I want to implement IP1 and IP2 on their own and then the TOP using the implemented IP1_NETLIST and IP2_NETLIST IPs. When I simulate the implemented design, now I have a new design: This feature is to provide an easy way to retrieve IP sources to interface with implementation tools. I didn't think of other scenarios, but maybe there are. FEATURE IMPLEMENTATIONRegarding the dependency search and the correct ordering, this is what my function ip_recursive_get_target_property does. It recursively looks for the INTERFACE_LINK_LIBRARIES property of a target/ip. By recursively searching and prepending the target/ip to a list, you get the dependencies in the correct order, as long as you linked them in the correct order. Then, I remove the duplicated entries keeping only the first occurrence to make sure the correct order is preserved. The CI tests are passing and on my relatively simple design it is also working, but I don't know if this scales properly. Now I'm using it only with the HWIP and the INTERFACE_LINK_LIBRARIES, so if a dependency is not listed on this property I don't see it, but as long as the targets/dependencies are HWIPs, I think it works. |
3f367d9 to
f0f67db
Compare
But what if you have something above, if you exclude B should D be excluded or not? Because C also depends on it. This kind of graph is what topological sorting solves, so from this there are 2 possible solutions:
But why don't you just use sources of IP1? Note that in regular CMake there a concept of PRIVATE, PUBLIC, INTERFACE, but we don't have that in SoCMake as it's not very clear how to do it for HDL languages.
I was worried that this would break the tests, as it would not correctly do the topological sort so some tests would fail. |
If you exclude B, D will remain as long as it is linked by another IP. If not, it is excluded when B is.
For very simple design yes, but for more complex ones it is often not good enough.
Yes I know, but sometimes we do link other kind of targets (e.g., C or C++ ones) and I was not sure if this change could break this. It shouldn't, as long as the functions of HWIP are used only for HDL sources. But for example the function get_ip_property is quite generic and I don't know if it was ever used to retrieve more standard cmake properties and where getting only the INTERFACE targets is not enough. We can also declare such use cases (if any) are not the intended way of using the HWIP functions.
Indeed, the test you mentioned (ip_link1) failed at the beginning because I was appending instead of prepending, but now it works. |
f085484 to
ff6f311
Compare
…fferent function that flatten_graph.
…epending the list during recursive search.
…recursive_get_target_property.
ff6f311 to
c55caba
Compare

Added EXCLUDED_IPS keyword argument to fetch IPs without certain dependencies with a simplified function to replace flatter_graph.